Simply Invoices now supports fetching your time data from Tick and Harvest. As previously mentioned I made a gem for Tick and now I’ve also made one for Harvest.

Installation

gem install tickspot-ruby
gem install harvest-ruby

The gems do not cover either of the APIs 100%. I implemented what I needed. If you need more, hack away!

Sources at github: Tick Ruby Gem and Harvest Ruby Gem.

Tickspot API Ruby Wrapper

April 12th, 2008

I’m investigating adding support for creating invoices from time logged in Tickspot to Simply Invoices. The first step of that is to write a ruby wrapper for their API. I’ve created a github project for that and am making it publicly available. You can find it at http://github.com/bricooke/tickspot-ruby. Hopefully someone finds it useful. Or even better, makes it more useful :)

To make it more accessible, it should probably be a gem :/ Baby steps.

Update 4/14/2008: It’s now a published gem. gem install tickspot-ruby

Update: See comment below from David Phillips: git add -u is all I needed. Thanks David.


After shuffling some code around I found myself with a lot of files to remove from git. Instead of doing it by hand or trying to ensure a subdirectory is gone and use -r, I wrote this rake task:

namespace :git do
  desc "Remove removed files"
  task :remove do
    system("for i in $(git status | grep deleted | awk ‘{print $3}’); do git rm $i; done")
  end
end

If you use sake, this task is available on pastie @ sake -T http://pastie.caboo.se/177861.txt

git stash apply syntax

February 28th, 2008

It took me a few tries to figure out how ‘git stash apply’ can apply a specific stash. The trick is you have to use the stash{@X} as listed in git stash list, not the string you gave it.

So if git stash list has

bcooke@cc $ git stash list
stash@{0}: On local-trunk: names changed to protect w/ correct files
stash@{1}: On local-trunk: the innocent
stash@{2}: On local-trunk: background that thing

To apply the stash named “background that thing” I just have to run

git stash apply stash@{2}

and all is well.

Aliasing http://localhost

January 11th, 2008

When working on multiple rails apps I’ve been annoyed that the URL field in the browser gets cluttered during autocomplete. My autocomplete for http://localhost:3000/ will have paths for each app I’ve worked on recently. Since the browser just sees them all as http://localhost:3000 it returs all the matches. Same problem for form auto-complete and 1password auto-complete.

There’s an easy way around this.

on a Mac or other *nix

Edit /etc/hosts and add one line per project. Here’s my /etc/hosts:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
127.0.0.1 cc
127.0.0.1 mlk
127.0.0.1 si

255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost

cc, si and mlk are abbreviations for sites I’m currently working on. With this in place I continue to start rails as ./script/server and it listens on localhost port 3000. But now when I’m working on ‘cc’ I point my browser at http://cc:3000. This makes it such that all autocompletes are now only for the ‘cc’ app. I find it a great benefit for such little effort.

Windows

Updated 1/12/07

Andy Kim commented that the windows hosts file is at C:\WINDOWS\System32\Drivers\etc\hosts

Continually burnt by @reply_to

October 10th, 2007

This has bitten me a number of times. When sending mail through ActionMailer/rails, @reply_to is not a valid way to set the reply to address. You must

@headers["reply-to"] = reply_address

This just came up in a project where there was existing code that had @replyto = replyaddress. Until today, no one really cared that the reply-to field wasn’t being set since it was always just the sender. Then today I happily come along and changed it to something other than the sender. Took me too long to figure this out.

Simply Invoices Launched

July 23rd, 2007

I’m happy to announce that Simply Invoices is now open to everyone. Have at it.

Check out the Simply Invoices blog for more info.

Today I started the semi-private beta for Simply Invoices. I’ve emailed every one that has subscribed to the mailing list with the details of the beta.

If you’re tracking your billable time in Basecamp, and would like to try Simply Invoices, shoot me an email at me@briantcooke.com and just mention that you’d like to join the beta.

The plan is to launch the public release next Tuesday. There are still a few things to tie up, but from what I can tell I’m on track for that date.

mybizexpenses Source Opened

June 27th, 2007

Earlier this week, someone asked if the source for mybizexpenses.com was available. At the time, it wasn’t. I’m now happy to say that it is.

Why?

I’m hopeful that this will make mybizexpenses more attractive to people who don’t want to host their expense info on the web. Those folks can now download the source and run it locally on their machine or on a private server of their choosing.

Where?

svn is at: svn://svn.roundhaus.com/roobasoft/mybizexpenses

You can browse the code at: https://roobasoft.roundhaus.com/projects/223-mybizexpenses

Is the hosted version going away?

Nope. That’s where my data is, so I have no plans to get rid of it.

Can I import the data I have stored from the hosted version?

Right now I have no export/import feature. If you want it, ask. Even better, write the code, submit a patch, and then ask me to deploy it ;)

What’s the license?

MIT. See the LICENSE file in the project dir.

Enjoy!

Note about hosting

I’m hosting the mybizexpenses sources on RoundHaus and am loving it. Jonathan Younger, the roundhaus developer, presented RoundHaus at a Boise Ruby Brigade meetup a couple months ago. At that time I got access to the beta and currently have five projects stored in RoundHaus, including the soon to be released Simply Invoices. Only the mybizexpenses project has annonymous access turned on.

RoundHaus is currently in a private beta. I’ll do a proper post on RoundHaus when it’s publicly available, but here are some things get out of it:

  • continuous integration (works with rspec)
  • nice visualization of code coverage (both at the whole project level and per file)
  • ability to run tests against MySQL, SQLite3 or Postgres
  • a gorgeous code browser
  • equally gorgeous diffs
  • super easy svn management (no more svnadmin command for me)
  • Twitter notifications for my build status (add in twitterrific and you’ve got an awesome build notification system)

Most of the above features can be seen via the public website. Give it a look an be sure to sign up for the notification when RoundHaus is publicly available (I hear it’ll be soon).

mybizexpenses.com is mentioned in the latest entry of the always educational, “The Rails Way”. Jamis points out how I should be using named callbacks and a simple way to make a confusing function, well, not confusing.

The article is pretty short, but very handy. I didn’t know named callbacks existed.

I really love how much a lot of the high profile rails folks give back to the community via things like this.


Icon by Erika Greco

Simply Invoices is a project I’ve been working on for about a month. The idea is to create a site where you enter in your basecamp info, select a project and a person and create invoices from the time logged for that person within a given time range. Since I track all my billable time in basecamp, this is something I really wanted.

I’m shooting for a mid-June beta and an early July launch. If you use basecamp to log your billable time, please sign up for the announcement mailing list. The first bunch of folks that sign up will be given access to the beta. There’ll also be discounted pricing for the first month after the site goes live to the public (and that discounted rate will be for the lifetime of your account, not just the 1st month).

I know there are a lot of different time tracking apps out there. Please let me know how you’re tracking your time (either in the comments, or email. I’d like to support as many inputs as makes sense.

I have an automator workflow that I’ve been using that others might find useful. It’s heavily based off of the web20show’s own script (original here). The biggest difference (if I remember right) is my flow takes the project directory as an argument vs. asking for it. It opens 3 iTerm tabs. 1 running ./script/server, 1 running autotest and 1 just sitting in your projects directory. localhost:3000 is then opened in your default browser (usually before the web server is ready) and TextMate is opened with the interesting directories loaded in (does not open ‘logs’ or ‘vendor’ or stuff like that).

For a long time I ran this as a Finder plugin. That required finding the project in Finder, right clicking on it and saying Automator -> RailsWork. Lately I’ve switched over to having the workflow be a .app and opening my project folder with that .app via QuickSilver.

I have a 48 second screencast of that in action. And of course, the workflow is available too: RailsWork.workflow.zip

update about requirements: The workflow uses TextMate, iTerm and requires TextMate be setup with its ‘mate’ command described here.

I had the need to highlight some words in some text. I started digging for a plugin to do this and then just some ruby code. Then I finally typed ‘highlight’ into gotapi.com and found this function in ActionView::Helpers::TextHelper:

highlight(text, phrase, highlighter = '\1')

The lesson I learned (again) was to always check the docs first!

mybizexpenses.com moved

May 1st, 2007

mybizexpenses.com was feeling really slow the past week or two. The problem was that it was on the same slice as all my other active projects (3 other rails apps (1 mongrel each)) and had to fight for resources (only 256MB of RAM on the slice). To help with this, I purchased another slice and mybizexpenses is currently all alone. Things should be much more responsive now.

If you get the “down for maintenance” message, it’ll go away once the DNS change propagates through the tubes.

Enjoy!

Oh, and while I was testing the new environment I noticed I have quite a few IE bugs in the AJAX stuff. I’ll fix that up when I get a chance (sorry).

Screencasts Galore!

March 28th, 2007

I’m a peepcode fan. For $9 you get a great, in depth tutorial on whatever the topic might be.

A week or two ago I learned about railscasts. These are just as pro as the for pay peepcodes, but they’re free. The big difference being the railscasts are very short. Often less than 5 minutes. Ryan picks something small to cover, and covers it well. Most of the time the topic is fairly novice, but I’d be lying if I said I didn’t learn anything.